package com.example.cmtwo.controller;

import com.example.cmtwo.service.OwnMesAmendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class OwnMesAmendController
{
    @Autowired
    private OwnMesAmendService OwnMesAmendS;

    @RequestMapping(value = "/amend1", method = RequestMethod.POST)
    @ResponseBody
    public boolean Amend1(@RequestParam("Uid") Integer Id, @RequestParam("username") String Name)
    {
        boolean result;
        System.out.println(Id);
        System.out.println(Name);

        result = OwnMesAmendS.updataName(Id,Name);

        return result;
    }

    @RequestMapping(value = "/amend2", method = RequestMethod.POST)
    @ResponseBody
    public boolean Amend2(@RequestParam("Uid") Integer Id, @RequestParam("sno") String Sno,
                          @RequestParam("phone") String Phone, @RequestParam("sex") String Sex,
                          @RequestParam("QQ") String QQ, @RequestParam("intro") String Intro)
    {
        boolean result;
        System.out.println(Id);
        System.out.println(Sno);
        System.out.println(Phone);
        System.out.println(Sex);
        System.out.println(QQ);
        System.out.println(Intro);
        result = OwnMesAmendS.updateOwnMes(Id, Sno, Phone, Sex, QQ, Intro);


        return result;
    }
}